;;; Copyright (c) 1999 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, see https://gnu.org/licenses or
;;; write to:
;;;  Free Software Foundatiom, Inc.
;;;  51 Franklin St, Fifth Floor
;;;  Boston, MA 02110-1301
;;;  USA

.AUXIL

;ALLOW USER TO USE SYMBOLS IN OTHER WAYS IF HE WISHES.
;BUT NORMALLY, DEFSYM FOO==BAR DOES FOO==BAR WITH ERROR CHECK.

IFNDEF DEFSYM,[
DEFINE DEFSYM X/
IRPS Z,,[X]
IFNDEF Z,X
.ELSE [
   $$TEM1==Z
   X
   IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
]
.ISTOP
TERMIN TERMIN

IFLE .MLLIT,.ERR .MLLIT MUST BE 1; SETTING IT TO 1.
.MLLIT==1
$$TEMP==1
];IF Not DEFined DEFSYM
.ELSE $$TEMP==0

;DISK PHYSICAL PARAMETERS (CENTURY DATA T-300 AND 2561 CONTROLLER)
;SINCE WE HAVE ALSO AN RH10 CONTROLLER, THESE ARE SUFFIXED WITH A 1

DEFSYM	NCYLS1==812.		;# CYLINDERS NORMALLY USED
DEFSYM	XCYLS1==815.-NCYLS1	;# CYLINDERS FOR SPARES, HACKS, ETC.
DEFSYM	NHEDS1==19.		;# TRACKS/CYLINDER
DEFSYM	NSECS1==32.		;# SECTORS/TRACK (256. 16-BIT WORDS)
DEFSYM	SECBL1==12.		;# SECTORS/BLOCK
DEFSYM	NBLKC1==NHEDS1*NSECS1/SECBL1 ;# BLOCKS/CYLINDER
DEFSYM	NBLKS1==NCYLS1*NBLKC1	;# BLOCKS NORMALLY USED
DEFSYM	XBLKS1==XCYLS1*NBLKC1	;# BLOCKS FOR HACKS
DEFSYM	TBLKS1==NBLKS1+XBLKS1	;TOTAL BLOCKS

DEFSYM	NTUTB1==4		;4 BLOCKS PER TUT HERE
DEFSYM	TUTBL1==MFDBLK-NTUTB1	;TUT ALSO STARTS AT A DIFFERENT PLACE

;TAKE DECADE FROM RH1O DEFS
;DEFSYM	DECADE==NBLKSC		;NUMBER OF BLOCKS TO ALLOCATE AT A TIME
;				;QSWAPA AND QLASTB MUST BE MULTIPLES OF THIS.
;				;DECADE SIZE = CYLINDER SIZE FOR KLFEDR'S SAKE

;10/11 COMMUNICATION AREA IS 14. WORDS STARTING 48. WORDS INTO THE 64.-WORD DL10 AREA

DEFSYM	DSCCHK=DL10AR+60	;MUST BE 2561 OCTAL
DEFSYM	DSCREQ=DL10AR+61	;SET NON-ZERO BY 10 TO SIGNAL REQUEST TO 11
DEFSYM	DSCDON=DL10AR+62	;SET NON-ZERO BY 11 TO SIGNAL DONE TO 10
DEFSYM	DSCFLT=DL10AR+63	;0 NO FAULT
DEFSYM	%DFRST==100000		;POWER CYCLED OR BROKEN, SO CONTROLLER WAS RESET
DEFSYM	%DFCQE==10000		;CONSISTENCY ERROR IN COMMAND QUEUE
DEFSYM	%DFNXM==4000		;NXM ERROR IN COMMAND QUEUE
DEFSYM	%DFPAR==2000		;PARITY ERROR IN COMMAND QUEUE
				; IF ONE OF THESE BITS IS ON, BITS 1-0 AND DSCSTS 
				; ARE THE ERROR ADDRESS
				;BITS 7-0 SYSTEM FAULT CODE IF LEFT BYTE IS ZERO
				; SEE THE 2561 OEM MANUAL FOR MEANING OF FAULT CODES
DEFSYM	DSCSTS=DL10AR+64	;STATUS BITS AS FOLLOWS
DEFSYM	%DSRTR==100000		;COMMAND WAS RETRIED
DEFSYM	%DSECH==40000		;UNCORRECTABLE DATA ERROR (ECC HARD)
DEFSYM	%DSECC==20000		;CORRECTED DATA ERROR
DEFSYM	%DSIDE==10000		;ID ERROR
DEFSYM	%DSHCE==4000		;ADDRESS ERROR (HEADER COMPARE ERROR)
DEFSYM	%DSPRT==2000		;WRITE-PROTECT STATUS OF SECTOR (ABORTS WRITE COMMAND)
DEFSYM	%DSALT==1000		;ALTERNATE-SECTOR STATUS (ABORTS READ, WRITE, AND CHECK)
DEFSYM	%DSOVR==400		;FIFO OVER-RUN, NOT CORRECTED BY 1 RETRY
DEFSYM	%DSSKE==200		;SEEK ERROR FROM DRIVE
DEFSYM	%DSOFL==100		;DRIVE OFF-LINE OR FAULT
DEFSYM	%DSFLT==20		;DRIVE FAULT
DEFSYM	%DSNXM==10		;NXM ON PDP11 MEMORY
DEFSYM	%DSPAR==4		;PARITY ERROR IN PDP11 MEMORY
DEFSYM	%DSSFL==2		;SYSTEM FAULT, SEE LOW BYTE OF DSCFLT
DEFSYM	%DSWLK==1		;DRIVE WRITE-LOCKED, WRITE ABORTED

DEFSYM	DSCCMD=DL10AR+65	;COMMAND CODE AS FOLLOWS
DEFSYM	%DMSNS==2		;SENSE DRIVE STATE.  DSCSTS GETS CODE FOR DRIVE TYPE IN
				; BITS 14-8 (10 FOR T-300), AND %DSWLK, %DSFLT, %DSOFL, %DSSKE
DEFSYM	%DMTST==3		;TEST SPECIFIED DRIVE (RUNS DIAGNOSTICS)
DEFSYM	%DMREC==4		;RECALIBRATE
DEFSYM	%DMSEK==5		;SEEK
DEFSYM	%DMWRT==6		;WRITE DATA
DEFSYM	%DMRED==20		;READ DATA.  ADD 1-10 FOR VARIOUS RECOVERY FEATURES AS
				; DOCUMENTED IN THE 2561 OEM MANUAL.

DEFSYM	DSCDRV=DL10AR+66	;DRIVE NUMBER (0 IS FIRST DRIVE ON 11)
DEFSYM	DSCCYL=DL10AR+67	;CYLINDER NUMBER
DEFSYM	DSCHED=DL10AR+70	;HEAD NUMBER
DEFSYM	DSCSEC=DL10AR+71	;SECTOR NUMBER
DEFSYM	DSCPNT=DL10AR+72	;4 12-BIT BYTE POINTERS TO DATA TO TRANSFER

IFN $$TEMP,EXPUNG DEFSYM
